#ifndef URBSERIALIZER_H
#define URBSERIALIZER_H

#include "MyBuffer.h"
#include <wdm.h>
#include <usb.h>

#define PACK_URB_SELECT_INTERFACE                  20
#define PACK_URB_SELECT_CONFIGURATION              21
#define PACK_URB_PIPE_REQUEST                      22
#define PACK_URB_GET_CURRENT_FRAME_NUMBER          23
#define PACK_URB_CONTROL_TRANSFER                  24
#define PACK_URB_CONTROL_TRANSFER_EX               25
#define PACK_URB_BULK_OR_INTERRUPT_TRANSFER        26
#define PACK_URB_ISOCH_TRANSFER                    27
#define PACK_URB_CONTROL_DESCRIPTOR_REQUEST        28
#define PACK_URB_CONTROL_GET_STATUS_REQUEST        29
#define PACK_URB_CONTROL_FEATURE_REQUEST           30
#define PACK_URB_CONTROL_VENDOR_OR_CLASS_REQUEST   31
#define PACK_URB_CONTROL_GET_INTERFACE_REQUEST     32
#define PACK_URB_CONTROL_GET_CONFIGURATION_REQUEST 33
#define PACK_URB_OS_FEATURE_DESCRIPTOR_REQUEST     34

class URBSerializer
{
  public:
    URBSerializer(){}
    ~URBSerializer(){}
    ULONG SerializeURB(PURB pUrb, PVOID pBuffer, ULONG bufferSize, BOOLEAN isCompleted);
    
  private:
    ULONG SerializeUrbHeader(_URB_HEADER *pHdr);
    ULONG SerializeTransferBuffer(ULONG length, PVOID pBuffer, PMDL pMDL);

    MyBuffer buffer;
};

#endif // URBSERIALIZER_H